<?php
namespace Libs\WeiXin;
use Libs\Curl\Curl;
use Libs\WeiXin\Weixin;
// +----------------------------------------------------------------------
// | TAODUDU.COM  [ Simple Efficient Excellent ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016 http://www.taodudu.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: ubten <462193409@qq.com> http://www.ubten.com/
// +----------------------------------------------------------------------


//优惠券
class Coupons extends WeiXin {
    
    
    //发放代金券
    public function createCoupons($stram)
    {
        $url = 'https://api.mch.weixin.qq.com/mmpaymkttransfers/send_coupon';
        $Curl = new Curl();
        $content = $Curl->post_ssl($url, $stram);
        $result = json_decode($content, true);
        return $this->get($result);
    }

    
    //查询代金券批次信息
    public function queryCoupons($stram)
    {
        $url = 'https://api.mch.weixin.qq.com/mmpaymkttransfers/query_coupon_stock';
        $Curl = new Curl();
        $content = $Curl->post($url,$stram);
        return $this->get($content);
    }

    
    //查询代金券信息
    public function infoCoupons($stram)
    {
        $url = 'https://api.mch.weixin.qq.com/mmpaymkttransfers/querycouponsinfo';
        $Curl = new Curl();
        $content = $Curl->post($url,$stram);
        return $this->get($content);
    }
    
    
}
